<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ClsConexionDB
 *
 * @author Jose Tejada
 */
class ConexionBD {

    private static $instance = null;

    private function __construct() {
        
    }

    public static function getInstance() {
        if ( self::$instance == null )
            $instance = new ConexionBD();

        return $instance;
    }

    public function getConexion() {
        $cn = null;
        try {
            $cn = new PDO( "mysql:host=localhost;dbname=db_sacv", "root", "" );
            $cn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
        } catch ( PDOException $e ) {
            throw new EcommerceException( "Error al conectarse a la BD" );
        }
        return $cn;
    }

}

?>
